<!DOCTYPE html>
<!-- METADATA: {"name": "RED简约风", "description": "RED风格PPT,极简主义,视觉冲击力强"} -->
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="{{ generator }}">
    <title>{{ title }}</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary-color: {{ colors.primary if colors else '#ff4757' }};
            --accent-color: {{ colors.accent if colors else '#2d3436' }};
            --bg-color: {{ colors.background if colors else '#ffffff' }};
            --text-color: {{ colors.text if colors else '#2d3436' }};
            --secondary-color: {{ colors.secondary if colors else '#636e72' }};
        }

        body {
            font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
            background: #f8f9fa;
            overflow-x: hidden;
        }

        .presentation {
            width: 100vw;
            scroll-snap-type: y mandatory;
            overflow-y: scroll;
            height: 100vh;
        }

        .slide {
            width: 100vw;
            height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            scroll-snap-align: start;
            position: relative;
            background: var(--bg-color);
            padding: 80px;
        }

        /* 封面页 */
        .slide-cover {
            background: linear-gradient(135deg, var(--primary-color) 0%, #2d3436 100%);
            color: white;
        }

        .slide-cover h1 {
            font-size: 5em;
            font-weight: 900;
            margin-bottom: 20px;
            letter-spacing: -2px;
            animation: fadeInUp 0.8s ease-out;
        }

        .slide-cover .subtitle {
            font-size: 1.8em;
            opacity: 0.9;
            animation: fadeInUp 1s ease-out 0.2s both;
        }

        /* 内容页 - RED极简风格 */
        .slide-content {
            background: var(--bg-color);
        }

        .slide-content .title {
            font-size: 4em;
            font-weight: 900;
            color: var(--primary-color);
            text-align: center;
            margin-bottom: 60px;
            letter-spacing: -1px;
        }

        .slide-content .points {
            display: flex;
            flex-direction: column;
            gap: 40px;
            align-items: center;
            width: 100%;
        }

        .slide-content .point {
            font-size: 2.5em;
            font-weight: 700;
            color: var(--text-color);
            text-align: center;
            padding: 20px;
            animation: fadeIn 0.6s ease-out;
        }

        .slide-content .point::before {
            content: '';
            display: inline-block;
            width: 8px;
            height: 8px;
            background: var(--primary-color);
            border-radius: 50%;
            margin-right: 20px;
        }

        /* 章节页 */
        .slide-section {
            background: var(--primary-color);
            color: white;
        }

        .slide-section .title {
            font-size: 5em;
            font-weight: 900;
            text-align: center;
            letter-spacing: -2px;
        }

        /* 总结页 */
        .slide-conclusion {
            background: linear-gradient(135deg, #2d3436 0%, var(--primary-color) 100%);
            color: white;
        }

        .slide-conclusion .title {
            font-size: 4em;
            font-weight: 900;
            margin-bottom: 60px;
            text-align: center;
        }

        .slide-conclusion .points {
            display: flex;
            flex-direction: column;
            gap: 30px;
            align-items: center;
        }

        .slide-conclusion .point {
            font-size: 2em;
            font-weight: 600;
            text-align: center;
        }

        /* 新增布局样式 */

        /* 数据表格 */
        .data-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 1.3em;
            margin: 20px 0;
        }

        .data-table thead {
            background: var(--primary-color);
            color: white;
        }

        .data-table th,
        .data-table td {
            padding: 18px 20px;
            text-align: left;
            border-bottom: 2px solid #e5e7eb;
        }

        .data-table tbody tr:hover {
            background: #f9fafb;
        }

        /* 卡片布局 */
        .card-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 30px;
            margin: 30px 0;
        }

        .card {
            background: #f8f9fa;
            padding: 30px;
            border-radius: 12px;
            border-left: 5px solid var(--primary-color);
        }

        .card-title {
            font-size: 1.6em;
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: 15px;
        }

        .card-content {
            font-size: 1.3em;
            color: var(--secondary-color);
            line-height: 1.6;
        }

        /* 大数字展示 */
        .number-showcase {
            text-align: center;
            margin: 40px 0;
        }

        .big-number {
            font-size: 7em;
            font-weight: 900;
            color: var(--primary-color);
            line-height: 1.2;
        }

        .big-number .unit {
            font-size: 0.4em;
            font-weight: 600;
            color: var(--secondary-color);
        }

        .number-label {
            font-size: 1.6em;
            color: var(--text-color);
            margin-top: 10px;
        }

        .number-trend {
            font-size: 1.4em;
            color: var(--secondary-color);
            margin-top: 15px;
        }

        .number-trend .highlight {
            color: var(--primary-color);
            font-weight: 700;
            font-size: 1.2em;
        }

        .supporting-numbers {
            display: flex;
            justify-content: center;
            gap: 50px;
            margin-top: 40px;
        }

        .mini-stat {
            text-align: center;
        }

        .stat-value {
            font-size: 2.5em;
            font-weight: 700;
            color: var(--primary-color);
        }

        .stat-label {
            font-size: 1.2em;
            color: var(--secondary-color);
            margin-top: 5px;
        }

        /* 对比布局 */
        .comparison-container {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 40px;
            margin: 40px 0;
        }

        .comparison-side {
            flex: 1;
            background: #f8f9fa;
            padding: 40px;
            border-radius: 12px;
        }

        .comparison-title {
            font-size: 2em;
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: 25px;
            text-align: center;
        }

        .comparison-content {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .metric {
            font-size: 1.4em;
            color: var(--text-color);
            padding: 10px 0;
            border-bottom: 1px solid #e5e7eb;
        }

        .comparison-divider {
            font-size: 4em;
            color: var(--primary-color);
            font-weight: 700;
        }

        /* 文本居中 */
        .text-center {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            text-align: center;
        }

        .large-text {
            font-size: 2.5em;
            font-weight: 600;
            color: var(--text-color);
            line-height: 1.5;
        }

        /* 要点列表样式 */
        .slide-content .points {
            display: flex;
            flex-direction: column;
            gap: 30px;
        }

        .slide-content .point-item {
            display: flex;
            align-items: flex-start;
            gap: 20px;
        }

        .slide-content .point-marker {
            flex-shrink: 0;
            width: 40px;
            height: 40px;
            background: var(--primary-color);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 1.2em;
        }

        .slide-content .point-content {
            flex: 1;
        }

        .slide-content .point-title {
            font-size: 1.6em;
            font-weight: 600;
            color: var(--text-color);
            margin-bottom: 10px;
        }

        .slide-content .point-detail {
            font-size: 1.2em;
            color: var(--secondary-color);
            line-height: 1.6;
        }

        .slide-content .slide-body {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
            overflow: hidden;
        }

        /* 页码 */
        .slide-number {
            position: absolute;
            bottom: 40px;
            right: 60px;
            font-size: 1.2em;
            opacity: 0.5;
            font-weight: 600;
        }

        /* 动画 */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        /* 键盘导航提示 */
        .nav-hint {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.7);
            color: white;
            padding: 10px 20px;
            border-radius: 20px;
            font-size: 0.9em;
            opacity: 0.7;
            z-index: 1000;
        }

        /* 打印样式 */
        @media print {
            .presentation {
                height: auto;
                overflow: visible;
            }
            .slide {
                page-break-after: always;
                height: auto;
                min-height: 100vh;
            }
            .nav-hint {
                display: none;
            }
        }
    </style>
</head>
<body>
    <div class="presentation">
        {% for slide in slides %}
        <div class="slide slide-{{ slide.type }}">
            {% if slide.type == 'cover' %}
                <h1>{{ slide.title }}</h1>
                {% if slide.subtitle %}
                <div class="subtitle">{{ slide.subtitle }}</div>
                {% endif %}

            {% elif slide.type == 'conclusion' %}
                <div class="title">{{ slide.title }}</div>
                {{ slide.content.html_content | safe }}

            {% elif slide.type == 'section' %}
                <div class="title">{{ slide.title }}</div>
                {% if slide.content.html_content %}
                {{ slide.content.html_content | safe }}
                {% endif %}

            {% else %}
                {# content页 - 使用HTML内容 #}
                <div class="title">{{ slide.title }}</div>
                <div class="slide-body">
                    {{ slide.content.html_content | safe }}
                </div>
            {% endif %}

            <div class="slide-number">{{ slide.slide_number }} / {{ slides|length }}</div>
        </div>
        {% endfor %}
    </div>

    <div class="nav-hint">使用 ↑ ↓ 或滚动查看</div>

    <script>
        // 键盘导航
        document.addEventListener('keydown', function(e) {
            const slides = document.querySelectorAll('.slide');
            const current = Math.round(document.querySelector('.presentation').scrollTop / window.innerHeight);

            if (e.key === 'ArrowDown' || e.key === 'PageDown') {
                e.preventDefault();
                if (current < slides.length - 1) {
                    slides[current + 1].scrollIntoView({ behavior: 'smooth' });
                }
            } else if (e.key === 'ArrowUp' || e.key === 'PageUp') {
                e.preventDefault();
                if (current > 0) {
                    slides[current - 1].scrollIntoView({ behavior: 'smooth' });
                }
            }
        });

        // 隐藏导航提示
        setTimeout(() => {
            document.querySelector('.nav-hint').style.opacity = '0';
            setTimeout(() => {
                document.querySelector('.nav-hint').style.display = 'none';
            }, 500);
        }, 3000);
    </script>
</body>
</html>
